{extend name="$LAYOUT_WECHAT_BASE" /}
{block name="title"}团购活动 - {__block__}{/block}
{block name="css"}
<link rel="stylesheet"  href="__ROOT__/addons/groupon/view/wechat/index/css/list.css?v={$v}">
{/block}
{block name="header"}
    <header class="ui-header ui-header-positive wst-se-header2" style="border-bottom: 1px solid #f6f6f8;">
		<a href="{:url('wechat/index/index')}"><i class="ui-icon-return"></i></a>
		<div class="wst-se-search">
		    <i class="ui-icon-search" onclick="javascript:searchGoods();"></i>
		    <form action＝"" class="input-form">
			<input type="search" value="{$keyword}" placeholder="按关键字搜索商品" onsearch="searchGoods()" autocomplete="off" id="wst-search">
			</form>
		</div>
       	<span class="wst-se-icon" onclick="javascript:dataShow();"></span>
	</header>
{/block}
{block name="footer"}
	{include file="$LAYOUT_WECHAT_FOOTER" /}
{/block}
{block name="main"}
	 <input type="hidden" name="" value="{$keyword}" id="keyword" autocomplete="off">
	 <input type="hidden" name="" value="{$goodsCatId}" id="goodsCatId" autocomplete="off">
	 <input type="hidden" name="" value="" id="currPage" autocomplete="off">
     <input type="hidden" name="" value="" id="totalPage" autocomplete="off">
     <section class="ui-container">
		<ul class="ui-tab-content" id="groupon-container" sc="{:date('Y-m-d H:i:s')}">
	        <li id="goods-list"></li>
	    </ul>
     </section>
<script id="list" type="text/html">
{{# if(d.data && d.data.length>0){ }}
{{# for(var i=0,goods=d.data; i<goods.length; i++){ }}
		   <div class="ui-row-flex wst-shl-list goods_{{ d.current_page }}" onclick="goGoods({{ goods[i].grouponId }})" sv="{{ goods[i].startTime }}" ev="{{ goods[i].endTime }}" st="{{ goods[i].status }}">
				<div class="ui-col">
				<div class="img j-imgAdapt"><a href="javascript:void(0);" onclick="goGoods({{ goods[i].grouponId }})">
				<img src="__RESOURCE_PATH__/{:WSTConf('CONF.goodsLogo')}" data-echo="__RESOURCE_PATH__/{{ goods[i].goodsImg }}" title="{{ goods[i].goodsName }}"></a></div>
				</div>
				<div class="ui-col ui-col-2 info">
					<div class="title ui-nowrap">{{ goods[i].goodsName }}</div>
					<p class="prices"><span class="discount">{{ goods[i].zhekou }}折</span><span class="price">¥{{ goods[i].grouponPrice }}</span><span class="price2">¥{{ goods[i].marketPrice }}</span>&nbsp;</p>
					<p>已售：{{ goods[i].orderNum }}件</p>
					<p class="time"><i></i><span class="countDown_{{ d.current_page }}"></span></p>
				</div>
			</div>
{{# } }}
{{# }else{ }}
<div class="wst-prompt-icon"><img src="__ROOT__/addons/groupon/view/wechat/index/img/groupon-goods.png"></div>
<div class="wst-prompt-info">
	<p>对不起，没有相关团购商品。</p>
</div>
{{# } }}
</script>
{/block}
{block name="include"}
{/* 遮盖层  */}
<div class="wst-cover" id="cover"></div>
{/* 分类层  */}
<div class="wst-fr-box" id="frame">
    <div class="title"><span>商品分类</span><i class="ui-icon-close-page" onclick="javascript:dataHide();"></i><div class="wst-clear"></div></div>
    <div class="content">
       <div class="ui-scrollerl">
            <ul>
                {volist name="$data['goodscats']" key="k" id="gc"}
                	<li id="goodscate" class="wst-goodscate {if($k==1)}wst-goodscate_selected{/if}" onclick="javascript:showRight(this,{$k-1});">{php}echo str_replace('、', '<br/>', $gc['catName']);{/php}</li>
                {/volist}
            </ul>
        </div>
        {volist name="$data['goodscats']" key="k" id="gc"}
        <div class="wst-scrollerr goodscate1" {if($k!=1)}style="display:none;"{/if}>
        {if(isset($gc['childList']))}
        {volist name="gc['childList']" key="k" id="gc1"}
            <ul>
                <li class="wst-goodsca">
                    <a href="javascript:void(0);" onclick="javascript:goodsCat({$gc1['catId']});"><span>&nbsp;{$gc1.catName}</span></a>
                    <a href="javascript:void(0);" onclick="javascript:goodsCat({$gc1['catId']});"><i class="ui-icon-arrow"></i></a>
                </li>
                <li>
                    <div class="wst-goodscat">
                        {volist name="$gc1['childList']" id="gc2"}
                        <span><a href="javascript:void(0);" onclick="javascript:goodsCat({$gc2['catId']});">{$gc2.catName}</a></span>
                        {/volist}
                    </div>
                </li>
            </ul>
        {/volist}
        {/if}
        </div>
        {/volist}
        <div class="wst-clear"></div>
    </div>
</div>
{/block}
{block name="js"}
<script type='text/javascript' src='__WECHAT__/js/jquery.min.js'></script>
<script type='text/javascript' src='__ROOT__/addons/groupon/view/wechat/index/js/list.js?v={$v}'></script>
<script type='text/javascript' src='__ROOT__/addons/groupon/view/wechat/index/js/time.js?v={$v}'></script>
{/block}